home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / FredFish PD 307.adf / FileIO / FileIO.i < prev    next >
Text File  |  1990-01-13  |  5KB  |  146 lines

  1. ;This is the assembly language INCLUDE file for the FileIO requester
  2.  
  3. ; The file IO which is returned by GetFileIO() looks like this
  4. ;
  5. ;    The FileIO structure (264 bytes):
  6. ;FileIO    dc.w  0      ;Flags WORD
  7. ;            ds.b  30     ;FileName buffer (contents must be NULL terminated)
  8. ;            ds.b  132    ;DrawerName buffer
  9. ;            ds.b  30     ;DiskName buffer
  10. ;            dc.l   0     ;DOS filehandle lock
  11. ;            dc.w   0     ;NameCount (total # of filenames in filename list)
  12. ;            dc.w   0     ;NameStart (ID of filename in top "select name" display)
  13. ;            dc.w   0     ;CurrentPick (ID of filename selected and highlighted)
  14. ;            dc.l NameKey ;address of Remember structure for filename list
  15. ;            dc.l   0     ;NextDisk Text (for SPECIAL_REQ)
  16. ;            dc.l   0     ;address of NextDisk handler (for SPECIAL_REQ)
  17. ;the next 2 fields are for WB pattern match (i.e. Icon files displayed only)
  18. ;            dc.w   0     ;DiskObjectType to match
  19. ;            dc.l   0     ;ToolTypes string address to match
  20. ;            dc.l   0     ;address of extension string to match
  21. ;            dc.w   0     ;size of extension string
  22. ;            dc.l   0     ;address of CustomHandler structure
  23. ;            dc.w   0     ;X position of the requester
  24. ;            dc.w   0     ;Y position of the requester
  25. ;            dc.l   0     ;free bytes on current disk
  26. ;            dc.l   0     ;bytesize of selected file (or 0 if the file doesn't exist yet)
  27. ;            dc.l   0     ;WindowTitle
  28. ;            dc.l   0     ;Buffer
  29. ;            dc.l   0     ;Rawkey Code
  30. ;            dc.l   0     ;OriginalLock (do not alter)
  31. ;            dc.b   0     ;Error number
  32. ;            dc.b   0     ;DrawMode
  33. ;            dc.b   0     ;PenA
  34. ;            dc.b   0     ;PenB
  35.  
  36. ; so here are the offsets from the base for each field:
  37.  
  38. FILEIO_FLAGS        equ 0
  39. FILEIO_FILENAME    equ 2
  40. FILEIO_DRAWER        equ 32
  41. FILEIO_DISK            equ 164
  42. FILEIO_LOCK            equ 194
  43. FILEIO_NAMECOUNT    equ 198
  44. FILEIO_NAMESTART    equ 200
  45. FILEIO_CURRPICK    equ 202
  46. FILEIO_FILELIST    equ 204
  47. FILEIO_TEXT            equ 208
  48. FILEIO_ROUTINE        equ 212
  49. FILEIO_MATCHTYPE    equ 216
  50. FILEIO_TOOLTYPES    equ 218
  51. FILEIO_EXTENSION    equ 222
  52. FILEIO_EXTSIZE        equ 226
  53. FILEIO_CUSTOM        equ 228
  54. FILEIO_X                equ 232
  55. FILEIO_Y                equ 234
  56. FILEIO_FREEBYTES    equ 236
  57. FILEIO_FILESIZE    equ 240
  58. FILEIO_TITLE        equ 244
  59. FILEIO_BUFFER        equ 248
  60. FILEIO_RAWCODE        equ 252
  61. FILEIO_ORIGINALLOCK    equ 256
  62. FILEIO_ERRNO        equ 260
  63. FILEIO_DRAWMODE    equ 261
  64. FILEIO_PENA            equ 262
  65. FILEIO_PENB            equ 263
  66.  
  67. SIZEOF_FILEIO        equ 264
  68.  
  69. ;  So, to access the FileIO's Tooltypes field, you can do this
  70. ;
  71. ;move.l  myFileIO,a0             ;the base returned from GetFileIO()
  72. ;move.l  FILEIO_TOOLTYPES(a0),d0 ;get the value in this field
  73.  
  74. ; Here the the flag bit numbers
  75.  
  76. NO_CARE_REDRAW        equ 0
  77. USE_DEVICE_NAMES    equ 1
  78. EXTENSION_MATCH    equ 2
  79. DOUBLECLICK_OFF    equ 3
  80. WBENCH_MATCH        equ 4
  81. MATCH_OBJECTTYPE    equ 5
  82. MULTIPLE_FILES        equ 6
  83. INFO_SUPPRESS        equ 7
  84.  
  85. ALLOCATED_FILEIO    equ 8        ;NEVER alter this
  86. CUSTOM_HANDLERS    equ 9
  87. WINDOW_OPENED        equ 10    ;NEVER alter this
  88. TITLE_CHANGED        equ 11
  89. NO_ALPHA                equ 12
  90. DISK_HAS_CHANGED    equ 13
  91. SHOW_DISK_NAMES    equ 14    ;for displaying disk instead of file names
  92. SPECIAL_REQ            equ 15    ;for displaying lists of strings
  93.  
  94. ; So to enable the USE_DEVICE_NAMES feature, do this
  95. ;
  96. ;movea.l  myFileIO,a0           ;the base
  97. ;move.w   FILEIO_FLAGS(a0),d0   ;get the current flags
  98. ;bset.l   #USE_DEVICE_NAMES,d0  ;enable this feature (clear the bit to disable)
  99. ;move.w   d0,FILEIO_FLAGS(a0)   ;save the new flags
  100.  
  101.  ;======= ERRNO numbers returned in FileIO error field =========
  102.  
  103. ERR_MANUAL  equ 1   ;the path was entered manually via the title bar with no
  104.                     ;errors or cancellation.
  105. ERR_SUCCESS equ 0   ;everything went OK in DoFileIO() or DoFileIOWindow()
  106. ERR_CANCEL  equ -1  ;the filename procedure was CANCELED by the user
  107. ERR_INUSE   equ -2  ;for SPECIAL_REQ, another task is using the requester
  108. ERR_APPGADG equ -3  ;the requester was CANCELED by an application gadget
  109.                     ;(via an installed CUSTOM gadget handler returning TRUE)
  110. ERR_WINDOW  equ -4  ;the window couldn't open (in DoFileIOWindow())
  111.  
  112.  ;====== AutoFileMessage() numbers =========
  113. ALERT_OUTOFMEM       equ  0
  114. ALERT_BAD_DIRECTORY  equ  1
  115. READ_WRITE_ERROR     equ  2 ; Error in reading or writing file
  116.  ;The next 3 display "YES" and "NO" prompts, returning d0=1 for yes, 0 for no
  117. FILE_EXISTS          equ  3 ; File already exists. Overwrite?
  118. SAVE_CHANGES         equ  4 ; Changes have been made. Save them?
  119. REALLY_QUIT          equ  5 ; Do you really want to quit?
  120.  
  121.  ;======FileIO library routine vector offsets from library base=====
  122. _LVODoFileIOWindow    equ -30
  123. _LVOGetFileIO            equ -36
  124. _LVODoFileIO            equ -42
  125. _LVOGetFullPathname    equ -48
  126. _LVOAutoFileMessage    equ -54
  127. _LVOReleaseFileIO        equ -60
  128. _LVOAutoMessage        equ -66
  129. _LVOSetWaitPointer    equ -72
  130. _LVOResetBuffer        equ -78
  131. _LVOAutoMessageLen    equ -84
  132. _LVOAutoPrompt3        equ -90
  133. _LVOUserEntry            equ -96
  134. _LVOPromptUserEntry    equ -102
  135. _LVOGetRawkey            equ -108
  136. _LVODecodeRawkey        equ -114
  137. _LVOTypeFilename        equ -120
  138. _LVOSetTitle            equ -126
  139. _LVOResetTitle            equ -132
  140. _LVOParseString        equ -138
  141. _LVONewEntryList        equ -144
  142. _LVOAddEntry            equ -150
  143. _LVOIsEntryThere        equ -156
  144. _LVORetrieveEntry        equ -162
  145. _LVOClearEntries        equ -168
  146.